home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Chat & Communication
/
Digsby build 37
/
digsby_setup.exe
/
lib
/
msn
/
MSNBuddies.pyo
(
.txt
)
< prev
next >
Wrap
Python Compiled Bytecode
|
2008-10-13
|
2KB
|
62 lines
# Source Generated with Decompyle++
# File: in.pyo (Python 2.5)
from MSNBuddy import MSNBuddy
from util.observe import ObservableDict
from common.sms import *
import util
from logging import getLogger
log = getLogger('msn.buddiesdict')
class MSNBuddies(ObservableDict):
def __init__(self, protocol):
ObservableDict.__init__(self)
self.protocol = protocol
def __getitem__(self, buddy):
if not buddy:
raise NameError
if util.is_email(buddy) and self in (self.protocol.buddies, self.protocol.f_buddies):
try:
return dict.__getitem__(self, buddy)
except KeyError:
return self.setdefault(str(buddy), MSNBuddy(name = buddy, msn = self.protocol))
except:
None<EXCEPTION MATCH>KeyError
None<EXCEPTION MATCH>KeyError
is_sms = validate_sms(buddy)
is_int = util.isint(buddy)
if (is_sms or is_int) and self is self.protocol.m_buddies:
try:
return dict.__getitem__(self, buddy)
except KeyError:
return dict.setdefault(self, str(buddy), MSNBuddy(name = buddy, msn = self.protocol))
except:
None<EXCEPTION MATCH>KeyError
None<EXCEPTION MATCH>KeyError
if self is self.protocol.f_buddies:
return dict.setdefault(self, buddy, MSNBuddy(name = buddy, msn = self.protocol))
else:
return self.protocol.f_buddies[buddy]
log.critical('Unknown buddy was requested: %r, %r', type(buddy), buddy)
raise KeyError(buddy)
def __delitem__(self, buddy):
return dict.__delitem__(self, str(buddy))
def __contains__(self, buddy):
return dict.__contains__(self, str(buddy))